package wzh.crm.ui.contact;

import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.View;

import java.io.Serializable;

import wzh.crm.bl.BL;
import wzh.crm.ui.DisplayListItemView;
import wzh.crm.vo.ContactVo;

/**
 * Created by wangzehao on 2016/5/23.
 */
public class ContactListItem extends DisplayListItemView<ContactVo> {
    public ContactListItem(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setModel(final ContactVo model) {
        super.setModel(model);
        setTitle("来自客户["+ BL.customerBL().getCustomerNameInBackGround(model.get所属客户id())+"]");
        setDetail(model.get姓名());

        this.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i=new Intent(getContext(),ContactDetailsActivity.class);
                i.putExtra("MODEL",model);
                getContext().startActivity(i);
            }
        });
    }

}
